<script setup>
import { onMounted, onBeforeMount } from "vue"
import { useTheme } from "@/hooks/useTheme"
import { useGreyAndColorWeakness } from "@/hooks/useGreyAndColorWeakness"
// import { ElNotification } from "element-plus"
import zhCn from "element-plus/es/locale/lang/zh-cn" // Element Plus 中文包
const { initTheme } = useTheme()
const { initGreyAndColorWeakness } = useGreyAndColorWeakness()

/** 初始化主题 */
initTheme()
/** 初始化灰色模式和色弱模式 */
initGreyAndColorWeakness()

// 移除之前的下拉框修正代码
// document.addEventListener("click", function (event) {
//   const select = event.target.closest(".el-select")
//   if (select) {
//     const selectInstance = select.__vueParentComponent.ctx
//     selectInstance.updatePopper()
//   }
// })

onMounted(() => {
  window.addEventListener("resize", () => {})
})
</script>

<template>
  <el-config-provider :locale="zhCn">
    <router-view />
  </el-config-provider>
</template>
